<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>商城登录</title>
    <%@include file="../common/header.jsp" %>
    <jsp:include page="../../common/layer.jsp"></jsp:include>
    <script type="text/javascript">
      $(function(){
    	  $("#btnSubmit").click(function(){
    		 var username= $("#username").val();
    		 var password=$("#password").val();
    		 console.info(username);
    		 if(username==""){
    			 alert("请输入用户名");
    			 return false;
    		 }else if(password==""){
    			 alert("请输入密码");
    			 return false;
    		 }
    		 
    		 var url="${pathUrl}/home/index/submitLogin";
    		 $.ajax({url:url,data:{username:username,password:password},type:'post',datatype:"json",success:function(resultObj){
    				if(resultObj.status==1){
    					window.location.href="${pathUrl}/home/index/index";
    				}else{
    					alert(resultObj.msg);
    				}
    		 }});
    		 
    		 
    	  });
      });
    </script>
</head>
<body>
<%@include file="../common/top.jsp" %>
<div class="section">
    <div class="nav-tit">
        <a class="selected" href="${pathUrl }/home/index/login">账户登录</a>
        <i>|</i>
        <a href="${pathUrl }/home/index/register">免费注册</a>
    </div>

    <form id="loginform" onsubmit="return false;" name="loginform" class="login-box"  method="post">
        <div class="input-box">
            <input  name="username" id="username" type="text" placeholder="用户名/手机/邮箱" maxlength="50">
        </div>
        <div class="input-box">
            <input name="password" id="password" type="password" placeholder="输入登录密码" maxlength="16">
        </div>
        <div class="btn-box">
            <input id="btnSubmit"  type="button"  value="立即登录">
        </div>
    </form>
</div>


<div class="section qitian-main">
    <img src="${pathUrl }/public/images/qitian.png">
</div>

<div class="footer-copyright">
    <p>软信商城©2013-2017 软信大学版权所有 京ICP备17017089号 京公网安备11000002000006号</p>
</div>
</body>
</html>